﻿@using System.Data
@using ZoomLa.Common
@model ZoomLa.SQLDAL.SQL.PageSetting
@{ 
    Model.cols = 7;
}
@functions{
    public string GetIcon(string icon)
    {
        icon = string.IsNullOrEmpty(icon) ? "/UploadFiles/nopic.gif" : icon;
        if (icon.Contains("/") || string.IsNullOrEmpty(icon))//判断是否为路径
        { return "<a href='" + icon + "' target='_bank'><img src='" + icon + "' onerror=\"this.src='/UploadFiles/nopic.gif'\" style='width:30px; height:30px;' /></a>";
        }
        return "<span class='" + icon + "'></span>";
    }
}
<table id="EGV" class="table table-striped table-bordered table-hover content_list">
    <tr>
        <td class="td_s"></td>
        <td>ID</td>
        <td class="egv_td_min60">学校微标</td>
        <td>学校名称</td>
        <td>地址</td>
        <td>添加时间</td>
        <td>操作</td>
    </tr>
    @foreach (DataRow dr in Model.dt.Rows)
    {
        <tr>
            <td><input name="idchk" type="checkbox" value='@dr["ID"]' /></td>
            <td>@dr["ID"]</td>
            <td>@MvcHtmlString.Create(GetIcon(dr["Country"].ToString()))</td>
            <td>@dr["SchoolName"]</td>
            <td>@(dr["Province"] + " " + dr["City"] + " " + dr["County"])</td>
            <td>@DataConverter.CDate(dr["AddTime"]).ToString("yyyy年MM月dd日 HH:mm")</td>
            <td>
                <a href="SchoolShow?id=@dr["ID"]" class="option_style" title="浏览"><i class="fa fa-eye"></i></a>
                <a href="AddSchool?id=@dr["ID"]" class="option_style" title="修改"><i class="fa fa-pencil"></i></a>
                <a href="javascript:;" onclick='mvcpage.del({url: "School_Del", ids: @dr["ID"], confirm: "确定要删除吗？"});' class="option_style"><i class="fa fa-trash"></i>删除</a>
                <a href="AddClassRoom?sid=@dr["ID"]" class="option_style"><i class="fa fa-plus"></i>添加班级</a>
            </td>
        </tr>
    }
    @Html.Partial("_page",Model)
</table>